//
//  ZBSheet.m
//  ZBDay
//
//  Created by xzb on 2018/2/28.
//  Copyright © 2018年 xzb. All rights reserved.
//

#import "ZBSheet.h"
#import "MMSheetView.h"
#import "ZBAlert.h"

@implementation ZBSheet

+ (void)sheetConfig
{
    // [MMSheetViewConfig globalConfig].titleFontSize = 12;
    // [MMSheetViewConfig globalConfig].titleColor = kColor_999999;
    // [MMSheetViewConfig globalConfig].buttonFontSize = 18;
    // [MMSheetViewConfig globalConfig].itemNormalColor = kBlackColor;//取消按钮
    // [MMSheetViewConfig globalConfig].itemHighlightColor = kColor_MainRed;//其他按钮
    // [MMSheetViewConfig globalConfig].itemDisableColor = kBlackColor;
}

+ (void)sheetWithTitle:(NSString *)title items:(NSArray <NSString *> *)items completion:(ZBAlertHandleBlcok)completion
{
    NSMutableArray *itemArray = [[NSMutableArray alloc] init];
    for (NSString *itemTitle in items) {
        [itemArray addObject:[@"H_" stringByAppendingString:itemTitle]];
    }
    [MMPopupWindow sharedWindow].hidden = NO;
    MMSheetView *sheetView = [[MMSheetView  alloc] initWithTitle:title items:[ZBAlert itemsForStrItems:itemArray completion:^(NSInteger index) {
        [MMPopupWindow sharedWindow].hidden = YES;
        if (completion) {
            completion(index);
        }
    }]];
    [sheetView show];
}


@end
